document.getElementById("addBtn").addEventListener("click", function () {
    const todoText = document.getElementById("todoInput").value;
    if (todoText) {
      const todoItem = document.createElement("li");
      todoItem.classList.add("todo-item");
      const checkbox = document.createElement("input");
      checkbox.type = "checkbox";
      const span = document.createElement("span");
      span.textContent = todoText;
      todoItem.appendChild(checkbox);
      todoItem.appendChild(span);
      document.getElementById("todoList").appendChild(todoItem);
      document.getElementById("todoInput").value = "";
    }
  });
  
  document.getElementById("todoList").addEventListener("change", function (event) {
    const checkbox = event.target;
    if (checkbox.type === "checkbox") {
      checkbox.parentElement.classList.toggle("done");
    }
  });